{itemplate 'public/header'}
<div class="page clearfix">
	<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data">
		<h3>基本设置</h3>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" value="1" name="status" id="status-1" {if $config_share['status'] == 1}checked{/if}>
					<label for="status-1">开启</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" value="0" name="status" id="status-0" {if $config_share['status'] == 0}checked{/if}>
					<label for="status-0">关闭</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">奖励类型</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" value="credit1" name="grantType" id="credit1" {if $config_share['grantType'] == 'credit1' || empty($config_share['grantType'])}checked{/if}>
					<label for="credit1">积分</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" value="credit2" name="grantType" id="credit2" {if $config_share['grantType'] == 'credit2'}checked{/if}>
					<label for="credit2">余额</label>
				</div>
				<span class="help-block">设置后请勿频繁变更</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享订单奖励</label>
			<div class="col-sm-9 col-xs-12">
				<input type="number" name="share_grant" value="{$config_share['share_grant']}" class="form-control" required="true" number="true">
				<span class="help-block">用户分享订单后可获得的奖励</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享订单奖励上限</label>
			<div class="col-sm-9 col-xs-12">
				<input type="number" name="share_grant_max" value="{$config_share['share_grant_max']}" class="form-control" required="true" number="true">
				<span class="help-block">用户分享订单后获得的奖励累计上限,超出后分享订单不再获得奖励</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">下单后几天内分享有效</label>
			<div class="col-sm-9 col-xs-12">
				<input type="number" name="share_grant_days_limit" value="{$config_share['share_grant_days_limit']}" class="form-control" required="true" digits="true">
				<span class="help-block">用户订单完成后在此时间内分享即可获得奖励,超出后此时间分享不再获得奖励</span>
			</div>
		</div>
		<h3>分享设置</h3>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享标题</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" name="title" value="{$config_share['share']['title']}" class="form-control" required="true">
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">分享描述</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" name="desc" value="{$config_share['share']['desc']}" class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">活动图片</label>
			<div class="col-sm-9 col-xs-12">
				{php echo tpl_form_field_image('imgUrl', $config_share['share']['imgUrl'])}
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-12">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>
		</div>
	</form>
</div>
{itemplate 'public/footer'}